using System;

namespace Admin.NET.Application.Service.Report.Dto;

public class IncomeReport
{
	/// <summary>
	/// 表名称
	/// </summary>
	public string MeterName { get; set; }

	/// <summary>
	/// 表编号
	/// </summary>
	public string MeterNo { get; set; }

	/// <summary>
	/// 当前电量
	/// </summary>
	public string NowFee { get; set; }

	/// <summary>
	/// 上月电量
	/// </summary>
	public string LastFee { get; set; }

	/// <summary>
	/// 新增电量
	/// </summary>
	public string AddFee
	{
		get
		{
			decimal nowFee = default(decimal);
			decimal lastFee = default(decimal);
			decimal.TryParse(NowFee, out nowFee);
			decimal.TryParse(LastFee, out lastFee);
			decimal addValue = nowFee - lastFee;
			return Math.Round(addValue, 2).ToString() ?? "";
		}
	}

	/// <summary>
	/// 比值
	/// </summary>
	public string Specific
	{
		get
		{
			decimal lastFee = default(decimal);
			decimal.TryParse(LastFee, out lastFee);
			if (lastFee == 0m)
			{
				return "--";
			}
			decimal addFee = Convert.ToDecimal(AddFee);
			if (addFee == 0m)
			{
				return "--";
			}
			return Math.Round(addFee / lastFee * 100m, 2).ToString() ?? "";
		}
	}
}
